<template>
	<view class="cont" @click="onDetail(item.id)">
		<view class="text-lg text-cut margin-bottom-xs">{{item.title}}</view>
		<view class="flex justify-between align-center margin-bottom-xs"> 
			<view class="text-lg"><text class="text-bold">× </text> {{item.stock}}</view>
			<block v-if="item.status == 1">
				<button class="cu-btn bg-green shadow-blur round">去使用</button>
			</block>
			<block v-if="item.status== 2">
				<text class="text-df text-gray">已完成</text>
			</block>
			<block v-if="item.status == 3">
				<text class="text-df text-orange">售后处理中</text>
			</block>
		</view>
		<view class="flex justify-between align-center">
			<text class="text-lg text-bold" style="color: #FC4E11;">￥{{item.price}}</text>
			<text class="text-sm text-gray">购买时间∶ {{item.created_at}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			onDetail(id) {
				let url = `/pages/Order/Detail/Detail?id=${id}`
				this.onGoNext(url)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.cont{
		margin: 0 30rpx;
		margin-top: 30rpx;
		padding: 30rpx 40rpx;
		background-color: #fff;
		border-radius: 12rpx;
		box-shadow: 6rpx 6rpx 8rpx rgba(#000, .01);
		.cu-btn{
			width: 164rpx;
			height: 58rpx;
			line-height: 58rpx;
		}
	}
</style>
